import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

public class testDate {
    public static void main(String[] args) {

        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMdd-HHmmss-");
        LocalDateTime dateTime = LocalDateTime.now();
        String string = dateTime.format(dateTimeFormatter).toString();


        System.out.println("string = " + string);

        long l = System.currentTimeMillis();
        System.out.println("l = " + l);
    }
}
